package com.jt.provider.service;

import com.alibaba.csp.sentinel.slots.block.BlockException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@Slf4j
@Component
public class ResourceBlockHandler {

    public static String doHandle(BlockException ex){
        log.error("block exception {}",ex.getMessage());
        return "访问太频繁了,稍等片刻再访问";
    }

    public static String doHandle(Integer id,BlockException ex){
        log.error("被限流了.... {}",ex);
        return "访问太频繁了.....";
    }
}
